package com.wzh.house.service.impl;

import org.springframework.stereotype.Service;
import java.util.Map;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.wzh.common.utils.PageUtils;
import com.wzh.common.utils.Query;

import com.wzh.house.dao.RentImgDao;
import com.wzh.house.entity.RentImgEntity;
import com.wzh.house.service.RentImgService;


@Service("rentImgService")
public class RentImgServiceImpl extends ServiceImpl<RentImgDao, RentImgEntity> implements RentImgService {

    @Override
    public PageUtils queryPage(Map<String, Object> params) {
        QueryWrapper<RentImgEntity> w = new QueryWrapper<>();
        w.eq("house_id",params.get("houseId"));
        IPage<RentImgEntity> page = this.page(
                new Query<RentImgEntity>().getPage(params),
                w
        );
        return new PageUtils(page);
    }

    @Override
    public void removeByHouseId(Integer houseId) {
        baseMapper.removeByHouseId(houseId);
    }

}